﻿<UserControl x:Class="Gao.Poker.App.Members.MemberMain"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:UserControls="clr-namespace:Gao.Poker.App.UserControls" mc:Ignorable="d">
    <Grid Margin="0">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="460"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Border  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" BorderBrush="{x:Null}" BorderThickness="0,1" Margin="3">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#A1C7CFDA" Offset="0.991"/>
                    <GradientStop Color="#B5F1F1F1"/>
                    <GradientStop Color="#FFD2D2D2" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
            <StackPanel Margin="0" Orientation="Horizontal" VerticalAlignment="Center">
                <Button Content="新增" VerticalContentAlignment="Center" FontSize="16" Click="New_Click" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
                <Button Content="修改" VerticalContentAlignment="Center" FontSize="16" Click="Modifiy_Click" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
                <!--<Button Content="补卡" VerticalContentAlignment="Center" FontSize="16" Style="{DynamicResource Blue}" Width="80" Click="Button_Click" />
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>-->
                <Button Content="消卡" VerticalContentAlignment="Center" FontSize="16" Click="Stop_Click" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
                <Button Content="充值" VerticalContentAlignment="Center" FontSize="16" Click="Recharge_Click" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
                <Button Content="导出" VerticalContentAlignment="Center" FontSize="16" Command="{Binding ExportCommand}" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
            </StackPanel>
        </Border>

        <Grid Grid.Column="0" Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="1">
                <TextBlock Text="姓名：" Margin="10,5,0,5" FontSize="14" VerticalAlignment="Center" />
                <TextBox Text="{Binding Path=MemberName}" Width="100" Margin="0,5,0,5" FontSize="14" />
                <TextBlock Text="会员卡号：" Margin="5,5,0,5" FontSize="14" Width="67" VerticalAlignment="Center" />
                <TextBox Text="{Binding Path=MemberCardNo}" Margin="0,5,0,5" Width="100" FontSize="14" />
                <Button x:Name="btnSearch" Margin="60,1,1,1" Width="55" Style="{DynamicResource Orrange}" Content="查询" RenderTransformOrigin="0.491,0.394" Height="25" FontSize="14" />
            </StackPanel>
            <DataGrid Grid.Row="1" Margin="1,1,1.2,1" VerticalAlignment="Top" RowHeight="30" AutoGenerateColumns="False"
                      SelectionMode="Single"  CanUserAddRows="True" CanUserResizeColumns="False" CanUserResizeRows="False"
                      ItemsSource="{Binding Path=Members}" SelectedItem="{Binding Path=Member}" IsReadOnly="True"
                      FontSize="16" Name="dgMembers" SelectionChanged="dgMembers_SelectionChanged" VerticalScrollBarVisibility="Auto">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="卡号" Width="120" Binding="{Binding Path=CardNo}"/>
                    <DataGridTextColumn Header="姓名" Width="90" Binding="{Binding Path=Name}"/>
                    <DataGridTextColumn Header="手机号" Width="120" Binding="{Binding Path=Telephone}"/>
                    <DataGridTextColumn Header="积分" Width="*" Binding="{Binding Path=Points}"/>
                </DataGrid.Columns>
            </DataGrid>
            <UserControls:Pager Grid.Row="2" Count="{Binding Path=MemberTotal}" PageIndexChanging="Pager_PageIndexChanging" />
        </Grid>
        <ContentControl Grid.Column="1" Grid.Row="1" Name="cc"/>
    </Grid>
</UserControl>
